<template>
    <div>
        
        <div class="jingping" :style="{'background':title === '积分攻略' ? 'white' : '#F5F5F5'}">
            <div class="banxin tanxin div-list">
                <div class="titles">
                        <img :src="src" alt="">
                        {{title}}
                </div>
                <div class="more" v-show="title !== '积分攻略'" >
                    <span>更多</span>
                    <img src="../../assets/images/home/Arrow.png" alt="">
                </div> 
            </div>
            <!-- li的组件部分 -->
            <ul class="list-ul banxin tanxin">
                <li v-for="item in AllInfo" :key="item.id">
                    <i>
                        <img src="@/assets/images/home/hot-j.png" v-if="item.isHotSale === 1" alt="">
                        <img src="@/assets/images/home/new-j.png" v-if="item.isLatest === 1" alt="">
                    </i>
                    <img :src="'http://sc.wolfcode.cn'+item.coverImg" alt="">
                    <p>{{item.name}}</p>
                    <span>{{item.coin}}
                        <img src="@/assets/images/home/monad.png" alt="">
                    </span>
                    <button>立即兑换</button>
                </li>
            </ul>

        </div>
    </div>
</template>

<script>
export default {
    data () {
        return {
        }
    },
    props :['title','src','AllInfo']
}
</script>
 
<style lang = "less" scoped>
    @import '../../assets/base.less';
    .jingping {
        .div-list {
            height: 106px;
            align-items: center;
            .titles {
                font-size: 30px;
                img {
                    width: 41px;
                }
            }
            .more {
                cursor: pointer;
                display: flex;
                align-items: center;
                img {
                    margin-left: 3px;
                }
            }
        }
        .list-ul {
            flex-wrap: wrap;
            justify-content: start;
            li {
                background-color: white;
                padding-bottom: 30px;
                margin: 25px 0;
                margin-right: 20px;
                cursor: pointer;
                &:nth-of-type(4n){
                    margin-right: 0;
                }
                text-align: center;
                position: relative;
                font-size: 18px;
                transition: all 0.2s ease-in;
                &:hover {
                    transform: translateY(-20px);
                    button {
                        background-color: #0A328E;
                        color: white;
                    }
                    span>img {
                    animation: run 2s ease-out infinite;
                    }
                }
                @keyframes run {
                    0%,10%,20%  { transform: rotateZ(0deg); }
                    5%,15% { transform: rotateZ(45deg); }
                }
                i {
                    img {
                        width: 58px;
                        height: 58px;
                        position: absolute;
                    }
                }
                img {
                    width: 285px;
                    height: 250px;
                    }
                p {
                    margin-top: 22px;
                }
                span {
                    display: block;
                    margin-top: 16px;
                    color: #FD604D;
                    font-weight: bold;
                    img {
                        width: 20px;
                        height: 20px;
                    }
                }
                button {
                    cursor: pointer;
                    margin-top: 20px;
                    width: 100px;
                    height: 36px;
                    border: 1px solid #0A328E;
                    color: #0A328E;
                    font-weight: bold;
                }


            }
            
            

        }
    }
</style>